﻿/*
Copyright © 2011 François Karman

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

See <license.txt> for the complete license of the software.
*/

using System;

namespace Simple.Storage
{
    /// <summary>
    /// Represents errors that occurs when a class is updated after its initialization.
    /// </summary>
    /// <seealso cref="Api.Initializable" />
    public class AlreadyInitializedException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the AlreadyInitializedException class.
        /// </summary>
        [Obsolete("A constructor with an explanation should be used")]
        public AlreadyInitializedException()
        {
        }

        /// <summary>
        /// Initializes a new instance of the AlreadyInitializedException class
        /// with a specified message.
        /// </summary>
        /// <param name="message">The details of the error.</param>
        public AlreadyInitializedException(string message)
            : base(message)
        {
        }

        /// <summary>
        /// Initializes a new instance of the AlreadyInitializedException class
        /// with a specified message that encapsulates an initial error.
        /// </summary>
        /// <param name="message">The details of the error.</param>
        /// <param name="inner">The initial error.</param>
        public AlreadyInitializedException(string message, Exception inner)
            : base(message, inner)
        {
        }
    }
}
